public class EvaluatorDiscrete extends java.lang.Object implements Evaluator
| Constructor and Description |
|---|
EvaluatorDiscrete()
Creates a new discrete evaluator with weight 0 and
no values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEvaluation(ValueDiscrete value,
java.lang.Integer evaluation)
Add a new possible value to the issue.
|
void |
clear()
wipe evaluation values.
|
EvaluatorDiscrete |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.Integer |
getEvalMax() |
java.lang.Double |
getEvaluation(UtilitySpace uspace,
Bid bid,
int issueID)
Returns the evaluation of the value of the issue of the bid.
|
java.lang.Double |
getEvaluation(ValueDiscrete value) |
java.lang.Integer |
getEvaluationNotNormalized(Bid bid,
int ID) |
java.lang.Integer |
getEvaluationNotNormalized(ValueDiscrete value) |
Value |
getMaxValue() |
Value |
getMinValue() |
EVALUATORTYPE |
getType() |
java.lang.Integer |
getValue(ValueDiscrete value) |
java.util.Set<ValueDiscrete> |
getValues() |
double |
getWeight() |
int |
hashCode() |
java.lang.String |
isComplete(Objective whichobj)
Check whether the evaluator has enough information to make an evaluation.
|
void |
loadFromXML(SimpleElement pRoot)
Method to
|
void |
lockWeight()
Locks the weight of this Evaluator.
|
java.lang.Double |
normalize(java.lang.Integer EvalValueL) |
void |
setEvaluation(Value val,
int evaluation)
Sets the evaluation for Value
val. |
void |
setWeight(double wt)
Sets the weigth with which an Objective or Issue is evaluated.
|
SimpleElement |
setXML(SimpleElement evalObj)
Sets weights and evaluator properties for the object in SimpleElement representation that is passed to it.
|
java.lang.String |
toString() |
void |
unlockWeight()
Unlock the weight of this evaluator.
|
boolean |
weightLocked() |
public EvaluatorDiscrete()
public double getWeight()
public void setWeight(double wt)
Evaluatorpublic void lockWeight()
lockWeight in interface Evaluatorpublic void unlockWeight()
unlockWeight in interface Evaluatorpublic boolean weightLocked()
weightLocked in interface Evaluatorpublic java.lang.Integer getValue(ValueDiscrete value)
value - of which the evaluation is requested.public java.lang.Integer getEvalMax()
throws java.lang.Exception
java.lang.Exception - if there are no alternatives.public java.lang.Double getEvaluation(UtilitySpace uspace, Bid bid, int issueID) throws java.lang.Exception
getEvaluation in interface Evaluatoruspace - preference profile.bid - of which we want a value evaluated.issueID - unique id of the issue of which we want the evaluation.java.lang.Exception - if problem, for instance illegal evaluation values.public java.lang.Double getEvaluation(ValueDiscrete value) throws java.lang.Exception
value - of the issue.java.lang.Exception - if value is null.public java.lang.Integer getEvaluationNotNormalized(Bid bid, int ID) throws java.lang.Exception
bid - ID - of the issue of which we are interested in the valuejava.lang.Exception - if bid or value is null.public java.lang.Integer getEvaluationNotNormalized(ValueDiscrete value) throws java.lang.Exception
value - of the issue.java.lang.Exception - if value is null.public java.lang.Double normalize(java.lang.Integer EvalValueL)
throws java.lang.Exception
EvalValueL - java.lang.Exception - if no evaluators or illegal values in evaluator.
ASSUMED that Max value is at least 1, becaues EVERY evaluatordiscrete is at least 1.public EVALUATORTYPE getType()
public void setEvaluation(Value val, int evaluation) throws java.lang.Exception
val. If this value doesn't exist yet in this Evaluator,
adds it as well.val - The value to add or have its evaluation modified.evaluation - The new evaluation.java.lang.Exception - if evaluationpublic void clear()
public void loadFromXML(SimpleElement pRoot)
EvaluatorloadFromXML in interface Evaluatorpublic SimpleElement setXML(SimpleElement evalObj)
evalObj - The object of which to set the evaluation properties.public java.lang.String isComplete(Objective whichobj)
EvaluatorisComplete in interface Evaluatorwhichobj - is the objective/issue to which this evaluator is attached.public void addEvaluation(ValueDiscrete value, java.lang.Integer evaluation)
value - to be added to the issue.evaluation - of the value.public Value getMaxValue()
public Value getMinValue()
public EvaluatorDiscrete clone()
public java.util.Set<ValueDiscrete> getValues()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object